Listing 11 - Page 0: No Title

##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 11\11.1476 - No Title.py
# Description: No Title
##############################################################################

import sqlite3
data = [("Joao", "98901-0109"),
        ("André", "98902-8900"),
        ("Maria", "97891-3321")]
connection = sqlite3.connect("phonebook.db")
cursor = connection.cursor()
cursor.executemany('''
      insert into phonebook (name, telephone)
      values(?, ?)
      ''', data)
connection.commit()
cursor.close()
connection.close()
Click here to download the file